﻿using HBKY.Shop.Entity.DB;
using HBKY.Shop.IRepository.Base;
using HBKY.Shop.IService.Customer;
using Microsoft.Extensions.Logging;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace HBKY.Shop.Service.Customer
{
    public class CustomerService : BaseService<CustomerEntity, CustomerService>, ICustomerService
    {
        public CustomerService(ILogger<CustomerService> logger, IRepository<CustomerEntity> _repository) : base(_repository, logger)
        { 
        
        
        }


        public async Task<List<CustomerListDto>> GetCustomerList()
        {
            var list = await Repository.GetList();
            return Mapper.Map<List<CustomerListDto>>(list);
        }


        /// <summary>
        /// 刪除
        /// </summary>
        public async Task<bool> DeleteCustomerById(long id)
        {
            return await Repository.DeleteById(id);
        }

    }
}
